* {
    padding: 0;
    margin: 0;
    box-sizing: border-box; /* 確保padding不影響整體寬度 */
}

header {
    background-color: #ffffff;
    height: 80px;
    width: 100%;
    position: fixed;
    display: flex; /* 優化導航佈局 */
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem; /* 添加內距，適應小螢幕 */
    z-index: 1000; /* 確保header在最上層 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header h1 {
    color: #000000; /* 黑色字 */
    line-height: 80px;
    background-image: url('images/eboam標準字.png');
    background-repeat: no-repeat;
    background-position: center;
    width: clamp(200px, 20vw, 350px);
    background-size: 50%;
    text-indent: -9999px;
}

header ul {
    display: flex;
    align-items: center;
    list-style: none;
    font-size: clamp(14px, 2vw, 18px);
}

header li {
    margin-right: clamp(1vw, 4vw, 4vw);
}

header a {
    color: #000000; /* 黑色字 */
    text-decoration: none;
}

header a:hover {
    color: #ff7e47; /* 懸停橙色 */
}

/* 首頁header樣式（黑色底白色字） */
header.首頁-header {
    background-color: rgb(0, 0, 0); /* 黑色底 */
}

header.首頁-header h1 {
    color: #ffffff; /* 白色字 */
    background-image: url('images/標準字.png');
}

header.首頁-header a {
    color: #ffffff; /* 白色字 */
}

header.首頁-header a:hover {
    color: #ff7e47; /* 懸停橙色 */
}

footer {
    background-color: #f1f1f1;
    color: #5c5c5c;
    min-height: 20vh;
    font-family: "Inter", sans-serif;
    display: flex;
    justify-content: space-between; /* 左邊內容靠左，右邊靠右 */
    align-items: flex-start; /* 內容靠頂部 */
    padding: 2rem; /* 添加內距 */
    box-sizing: border-box;
}

.左邊區塊 {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 圖片與文字頂部對齊 */
    margin-top: 0.5rem;
    margin-left: 5rem;
}

.eboam-logo {
    width: 150px; /* 縮小圖片，可調整 */
    height: auto;
    margin-bottom: 0.3rem;
}

.文字區 {
    text-align: left; /* 文字靠左對齊 */
}

.文字區 .email {
    font-size: 20px; /* 電子郵件文字大小 */
    margin: 0;
    line-height: 1.5;
}

.文字區 .copyright {
    font-size: 14px; /* 版權文字大小 */
    margin: 0;
    line-height: 1.5;
    margin-top: 1rem;
}

.社群-icon {
    width: 200px; /* 設定icon大小，可調整 */
    height: auto;
    margin-right: 5rem;
    margin-top: 1rem;
}

.情境 {
    min-height: 110vh;
    background-image: url('images/地圖動態.gif');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center 20%;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 內容靠左 */
    justify-content: flex-start; /* 內容靠頂部 */
    position: relative; /* 作為絕對定位的參考 */
    padding: 2rem; /* 內距 */
    box-sizing: border-box;
    transition: transform 0.5s ease; /* 背景放大效果 */
    overflow: hidden;
}

.情境放大 {
    transform: scale(2.0); /* 放大背景1.5倍 */
}

.車禍排行 {
    width: 100%;
    max-width: 300px; /* 縮小圖片 */
    height: auto;
    position: absolute; /* 固定在左上角 */
    top: 10rem; /* 距離頂部 */
    left: 5rem; /* 距離左邊 */
    transition: opacity 0.3s ease; /* 隱藏時的淡出效果 */
}

.車禍排行圖 {
    width: 100%;
    height: auto;
}

.排行1觸發區 {
    position: absolute;
    top: 57%; /* 不同位置，例如左上 */
    left: 34%;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%);
}

.排行1 {
    height: auto;
    display: none;
    max-width: 70px;
}

.排行1觸發區:hover .排行1 {
    display: block;
}

.排行1圖 {
    width: 100%;
    max-width: 200px;
    height: auto;
    cursor: pointer;
}

/* 排行2 */
.排行2觸發區 {
    position: absolute;
    top: 46%; /* 不同位置，例如中間偏左 */
    left: 74%;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%);
}

.排行2 {
    height: auto;
    display: none;
    max-width: 70px;
}

.排行2觸發區:hover .排行2 {
    display: block;
}

.排行2圖 {
    width: 100%;
    max-width: 200px;
    height: auto;
    cursor: pointer;
}

.排行3觸發區 {
    position: absolute;
    top: 25%;
    left: 50%;
    width: 100px; /* 觸發區域寬度 */
    height: 100px; /* 觸發區域高度 */
    transform: translate(-50%, -50%);
}

.排行3 {
    height: auto;
    display: none; /* 預設隱藏 */
    max-width: 70px;
}

.排行3觸發區:hover .排行3 {
    display: block; /* 滑鼠懸停時直接顯示 */
}

.排行3圖 {
    width: 100%;
    max-width: 200px; /* 假設大小，可調整 */
    height: auto;
    cursor: pointer; /* 表示可點擊 */
}

.排行1原因 {
    position: absolute;
    top: 47%; /* 排行1原因位置：左上偏中 */
    left: 6%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.排行2原因 {
    position: absolute;
    top: 39%; /* 排行2原因位置：中間偏右 */
    left: 46%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.排行3原因 {
    position: absolute;
    top: 22%; /* 排行3原因位置：中間偏左 */
    left: 25%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.排行1原因顯示, .排行2原因顯示, .排行3原因顯示 {
    opacity: 1;
    visibility: visible;
}

.排行1原因圖, .排行2原因圖, .排行3原因圖 {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* 筆電螢幕 (1600px以下) */
@media (max-width: 1600px) {
    .車禍排行 {
        max-width: 230px; /* 稍微縮小 */
    }
    .排行1觸發區 {
        top: 65%;
        left: 34.5%;
    }

    .排行2觸發區 {
        top: 49.5%;
        left: 80.5%;
    }
    .排行3觸發區 {
        top: 25.5%;
        left: 50.5%;
        width: 100px; /* 調整觸發區 */
        height: 100px;
    }
    .排行3, .排行1, .排行2 {
        max-width: 60px;
    }
    .排行1原因 {
        top: 50%;
        left: 3.5%;
    }
    .排行2原因 {
        top: 40%;
        left: 48%;
    }
    .排行1原因圖, .排行2原因圖, .排行3原因圖 {
        max-width: 300px;
    }
}

.user-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-image: url('images/user.png');
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

/* 調整導航項樣式，確保 ICON 垂直置中 */
header nav ul li#login-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: none;
    position: absolute;
    top: 60px; /* 位於 ICON 下方 */
    right: 10px; /* 靠右對齊 */
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 120px;
}

.user-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 14px;
    color: #5c5c5c;
    background-color: #ffffff;
    border: none;
    border-bottom: 1px solid #ccc;
    text-align: left;
    cursor: pointer;
    font-family: "Inter", sans-serif;
}

.user-menu button:last-child {
    border-bottom: none;
}

.user-menu button:hover {
    background-color: #ff914c;
    color: #ffffff;
}